package com.yds.ydsdatasetbackend.common;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Category {
    private Long id;
    private Long parentId;
    private String name;
    private List<Category> children = new ArrayList<>();

    // Getters and Setters

    public Category(Long id, Long parentId, String name) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
    }


    // Add child category
    public void addChild(Category child) {
        this.children.add(child);
    }
}
